/* Ejercicio 3.48
   ejer3_48.c */
#include <stdio.h>

/* funcion main, el programa inicia aca */
int main( void )
{
    int dnac, mnac, ynac, d, m, y;
    int totaldays;
    float age;
    float mhr, thr1, thr2;

    printf( "Enter your birthday in the next way: (dd mm aaaa): " );
    scanf( "%d%d%d", &dnac, &mnac, &ynac );
    printf( "Enter the current dayin the next way: (dd mm aaaa): " );
    scanf( "%d%d%d", &d, &m, &y );
    totaldays = d + m * 30 - ( dnac + mnac * 30 );
    age = y - ynac + totaldays / 365.0;
    mhr = 220 - age;
    thr1 = 0.5 * mhr;
    thr2 = 0.85 * mhr;

    printf( "Your maximun heart rate is: %.2f\n", mhr );
    printf( "The range of your target heart rate is: %.2f - %.2f", thr1, thr2 );
	return 0;
} /* fin de la funcion main */
